#pragma once
#include "PredefinedMessages.h"
#include "netmessage.h"
#include "netmessageManager.h"


namespace _FOGGE_
{

	namespace _PMESSAGE_// predefined messages
	{
		namespace _NET_
		{
			/**
			Predefined TCP Messages
			*/

			class PNM_NOT_AddPeer:
				public _FOGGE_::_NET_::NetMessage
			{
				FoDeclareRegisterFuntion(PNM_NOT_AddPeer);
			public:
				bool EncodeToCommBuffer( _FOGGE_::_NET_::CommBuffer *buffer ) ;

				bool DecodeFromCommBuffer( _FOGGE_::_NET_::CommBuffer *buffer );


				

				foUChar	m_ucPeerIndex;//* Peer's Index*/

				DWORD			m_dwLocalAddress;//* Peer's Local IP for local p2p*/
				WORD  m_usLocalPort;//* Peer's Local Port for local p2p*/
				DWORD			m_dwPublicAddress;//* Peer's Public IP for hole punching p2p*/
				WORD  m_usPublicPort;//* Peer's Public Port for hole punching p2p*/
				DWORD			m_dwRelayAddress;//* Peer's Relay Server IP for Relaying*/
				WORD  m_usRelayPort;//* Peer's Relay Server Port for Relaying*/

	
			};

			///////////////////////////PNM_NOT_AddPeer///////////////////////////////////////////////


			class PNM_NOT_RemovePeer:
				public _FOGGE_::_NET_::NetMessage
			{
				FoDeclareRegisterFuntion(PNM_NOT_RemovePeer);
			public:
				bool EncodeToCommBuffer( _FOGGE_::_NET_::CommBuffer *buffer ) ;

				bool DecodeFromCommBuffer( _FOGGE_::_NET_::CommBuffer *buffer );
			
				foUChar	m_ucPeerIndex;//* Peer's Index*/

			};
			///////////////////////////PNM_NOT_RemovePeer///////////////////////////////////////////////



			/**
			Predefined UDP Messages
			*/

			class PNUM_ConnectionCheck :
				public _FOGGE_::_NET_::UDPNetMessage
			{
				FoDeclareRegisterFuntion(PNUM_ConnectionCheck);
			public:
				enum ENUM_CheckStap
				{
					eCS_Request,
					eCS_ReplyAndRequest,
					eCS_Reply
				};
				


				ENUM_CheckStap m_eStep;


			protected:
				
				bool EncodeUDPDataToCommBuffer( _FOGGE_::_NET_::CommBuffer *buffer ) const;

				bool DecodeUDPDataFromCommBuffer( _FOGGE_::_NET_::CommBuffer *buffer );
			};
			///////////////////////////PNUM_ConnectionCheck///////////////////////////////////////////////
		}
	}
}
namespace _PNMSG=_FOGGE_::_PMESSAGE_::_NET_;